import numpy as np

X = np.array([[1.2, 1.5, 1.8],              [1.3, 1.4, 1.9],              [1.1, 1.6, 1.7]])
y = np.array([5, 10, 9]).T
#循环计算
sum = 0
for i in range(0,X.shape[0]):
    for j in range(0,X.shape[1]):
        sum += X[i,j]*y[j]
print("循环计算总价为{}".format(sum))
#点乘计算
sum2 = np.sum(X.dot(y))
print("矩阵点乘计算总价为{}".format(sum2))
